package com.example.contentcenter.feignclient;

import com.example.contentcenter.domain.dto.user.UserDTO;
import com.example.contentcenter.feignclient.fallback.UserCenterFeignClientFallback;
import com.example.contentcenter.feignclient.fallbackfactory.UserCenterFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @ClassName: UserCenterFeignClient
 * @Author: lerry_li
 * @CreateDate: 2021/05/30
 * @Description
 */
@FeignClient(name = "user-center",
//        fallback = UserCenterFeignClientFallback.class,
        fallbackFactory = UserCenterFeignClientFallbackFactory.class)
public interface UserCenterFeignClient {
    /**
     * http://user-center/users/{id}
     * @param id
     * @return
     */
    @GetMapping("/users/{id}")
    UserDTO findById(@PathVariable Integer id);
}
